import request from '@/utils/request';

// 查询终端信息列表
export function getOauthClientDetailsPage(params) {
    return request.get('/system/oauth-client-details/page', { params: params });
}

// 查询终端信息详情
export function getOauthClientDetails(id: number) {
    return request.get(`/system/oauth-client-details/get?id=${id}`);
}

// 新增终端信息
export function createOauthClientDetails(data) {
    return request.post('/system/oauth-client-details/create', { data: data });
}

// 修改终端信息
export function updateOauthClientDetails(data) {
    return request.put('/system/oauth-client-details/update', { data: data });
}

// 删除终端信息
export function deleteOauthClientDetails(id: number) {
    return request.delete(`/system/oauth-client-details/delete?id=${id}`);
}

// 跳转
export function jump(clientId: string, redirectUri: string) {
    return request.get(`/oauth2/authorize?response_type=code&client_id=${clientId}&scope=profile&redirect_uri=${redirectUri}`, { maxRedirects: 0 });
}
